Skip to content

[GUROBI] Change error message for non-existent constraint#102

Merged
metab0t merged 1 commit into
metab0t:masterfrom
staadecker:ms/fix
Jul 22, 2026
Merged

[GUROBI] Change error message for non-existent constraint#102
metab0t merged 1 commit into
metab0t:masterfrom
staadecker:ms/fix

Conversation

@staadecker

Copy link
Copy Markdown
Contributor

This pull request fixes an issue where the following code

import pyoptinterface as poi
from pyoptinterface.gurobi import Model

m = Model()
x = m.add_variable()
constr = m.add_linear_constraint(x >= 1)
m.delete_constraint(constr)
m.get_constraint_attribute(constr, poi.ConstraintAttribute.Name)

outputs

RuntimeError: Variable does not exist

instead of

RuntimeError: Constraint does not exist

@metab0t
metab0t merged commit 99f2fa4 into metab0t:master Jul 22, 2026
@metab0t

metab0t commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants